import bus from '@/bus'
import { renderButton } from '@/util'
let data = {
  status: 'pass',
  columns: [{
    title: '巡店记录名称',
    key: 'inspectionName',
    align: 'left',
    width: 250
  }, {
    title: '职能归类',
    key: 'roleTypeName',
    align: 'left',
    width: 250
  }, {
    title: '角色',
    key: 'roleStrs',
    align: 'left',
  }, {
    title: '门店类型',
    key: 'roleStrs',
    align: 'left',
    render: (h, params) => {
      var text = ''
      params.row.inspectionStoreTypes.forEach((item, index) => {
        text = text + item.storeTypeName + `（${item.frequency}）` + (params.row.inspectionStoreTypes.length > index + 1 ? '、' : '')
      })
      return h('div', text)
    },
  }, {
    title: '操作',
    align: 'left',
    width: 250,
    render: (h, params) => {
      return (
        <div>
          { renderButton(h, { text: '编辑', type: 'primary', },
            ()=>{ bus.$emit('onEdit', params.row) })}
        </div>
      )
    }
  }],
  data: []
}
export default data